package com.sl.hx.shop.ui.classify.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sl.hx.shop.R;
import com.sl.hx.shop.bean.GoodsClassify;

import java.util.List;

public class ClassifyListAdapter extends BaseQuickAdapter<GoodsClassify.SubBean,BaseViewHolder> {

    public ClassifyListAdapter(@Nullable List<GoodsClassify.SubBean> data) {
        super(R.layout.item_classifylist, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, GoodsClassify.SubBean item) {
        ImageView logo = helper.getView(R.id.logo);
        helper.setText(R.id.name,item.getName());
        Glide.with(mContext).load(item.getLogo()).apply(RequestOptions.placeholderOf(R.drawable.classify_bitmap)).into(logo);
    }
}
